export function routers() {
    const doctors = {
        path: '/doctors',
        name: 'doctors',
        meta: {
            title: '医生列表',
        },
    };
    const imagetext = {
        path: '/imagetext',
        name: 'imagetext',
        meta: {
            title: '图文管理',
        },
    };
    const cases = {
        path: '/cases',
        name: 'cases',
        meta: {
            title: '案例列表',
            keepAlive: true,
        },
    };
    return [
        {
            path: '/appointment',
            name: 'appointment',
            meta: {
                title: '预约中心',
            },
            component: () => import('@/app/views/user/appointment/index'),
        },
        {
            path: '/userlist',
            name: 'userlist',
            meta: {
                title: '用户列表',
            },
            component: () => import('@/app/views/user/users/userlist/index'),
        },
        {
            path: '/revisit',
            name: 'revisit',
            meta: {
                title: '回访列表',
            },
            component: () => import('@/app/views/user/users/revisit/index'),
        },
        {
            path: '/adminuser',
            name: 'adminuser',
            meta: {
                title: 'KOL推荐用户',
            },
            component: () => import('@/app/views/user/users/adminuser/index'),
        },
        {
            path: '/noreprot',
            name: 'noreprot',
            meta: {
                title: '待报备用户',
                method: 'iyaReport/noReportCount',
            },
            component: () => import('@/app/views/user/users/noreprot/index'),
        },
        {
            path: '/userbookcount/:mu',
            name: 'userbookcount',
            meta: {
                title: '预约订单',
            },
            component: () => import('@/app/views/user/users/userbookcount'),
        },
        {
            path: '/uservisitcount/:mu',
            name: 'uservisitcount',
            meta: {
                title: '医生访问',
            },
            component: () => import('@/app/views/user/users/uservisitcount'),
        },
        {
            path: '/usercasevisit/:mu',
            name: 'usercasevisit',
            meta: {
                title: '案例访问',
            },
            component: () => import('@/app/views/user/users/usercasevisit'),
        },
        {
            path: '/usersearch/:mu',
            name: 'usersearch',
            meta: {
                title: '搜索记录',
            },
            component: () => import('@/app/views/user/users/usersearch'),
        },
        {
            path: '/userreport/:mu',
            name: 'userreport',
            meta: {
                title: '报备列表',
            },
            component: () => import('@/app/views/user/users/userreport'),
        },
        {
            path: '/reports',
            name: 'reports',
            meta: {
                title: '已报备用户',
            },
            component: () => import('@/app/views/user/reports/index'),
        },
        {
            path: '/searchhistory',
            name: 'searchhistory',
            meta: {
                title: '搜索历史',
            },
            component: () => import('@/app/views/user/searchhistory/index'),
        },
        {
            ...imagetext,
            component: () => import('@/app/views/imagetext/index'),
        },
        {
            path: '/addImagetext',
            name: 'addImagetext',
            meta: {
                title: '新增图文',
                breadcrumb: [{ ...imagetext }],
            },
            component: () => import('@/app/views/imagetext/add'),
        },
        {
            path: '/updateImagetext',
            name: 'updateImagetext',
            meta: {
                title: '修改图文',
                breadcrumb: [{ ...imagetext }],
            },
            component: () => import('@/app/views/imagetext/update'),
        },
        {
            path: '/open',
            name: 'open',
            meta: {
                title: '开放平台',
            },
            component: () => import('@/app/views/open/admin/index'),
        },
        {
            path: '/relate',
            name: 'relate',
            meta: {
                title: '关联用户',
            },
            component: () => import('@/app/views/open/admin/relate'),
        },
        {
            path: '/adminorder',
            name: 'adminorder',
            meta: {
                title: 'KOL推荐订单',
            },
            component: () => import('@/app/views/open/adminorder/index'),
        },
        {
            path: '/admindeal',
            name: 'admindeal',
            meta: {
                title: 'KOL推荐成交',
            },
            component: () => import('@/app/views/open/admindeal/index'),
        },
        {
            path: '/dict',
            name: 'dict',
            meta: {
                title: '搜索映射',
            },
            component: () => import('@/app/views/doctor/dict/index'),
        },
        {
            path: '/city',
            name: 'city',
            meta: {
                title: '城市管理',
            },
            component: () => import('@/app/views/doctor/city/index'),
        },
        {
            path: '/hot',
            name: 'hot',
            meta: {
                title: '热门医生',
            },
            component: () => import('@/app/views/doctor/hot/index'),
        },
        {
            ...doctors,
            component: () => import('@/app/views/doctor/doctors/index'),
        },
        {
            path: '/addDocter',
            name: 'addDocter',
            meta: {
                title: '添加医生',
                breadcrumb: [{ ...doctors }],
            },
            component: () => import('@/app/views/doctor/doctors/add'),
        },
        {
            path: '/updateDocter',
            name: 'updateDocter',
            meta: {
                title: '修改医生',
                breadcrumb: [{ ...doctors }],
            },
            component: () => import('@/app/views/doctor/doctors/update'),
        },
        {
            path: '/doctoral',
            name: 'doctoral',
            meta: {
                title: '增加案量',
                breadcrumb: [{ ...doctors }],
            },
            component: () => import('@/app/views/doctor/al/index'),
        },
        {
            ...cases,
            component: () => import('@/app/views/doctor/cases/index'),
        },
        {
            path: '/addCase',
            name: 'addCase',
            meta: {
                title: '增加案例',
                breadcrumb: [{ ...cases }],
            },
            component: () => import('@/app/views/doctor/cases/add'),
        },
        {
            path: '/updateCase',
            name: 'updateCase',
            meta: {
                title: '修改案例',
                breadcrumb: [{ ...cases }],
            },
            component: () => import('@/app/views/doctor/cases/update'),
        },
    ];
}

export function baseUrl() {
    let baseUrl = '';
    switch (process.env.NODE_ENV) {
        case 'development':
            baseUrl = '';
            break;
        case 'production':
            baseUrl = '/iya-api';
            break;
    }
    return baseUrl;
}

export function appInfo() {
    return {
        headTitle: '矮芽',
        platformMu: '2',
    };
}

export function SideMenuData() {
    let m = new Map();
    m.set('/noreprot', '/iyaReport/noReportCount');
    return m;
}
